package com.team2.outpatient_sys.service.impl;

import com.team2.outpatient_sys.dao.QueueUpDao;
import com.team2.outpatient_sys.pojo.QueueUp;
import com.team2.outpatient_sys.service.QueueUpService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class QueueUpServiceImpl implements QueueUpService {

    @Autowired
    private QueueUpDao queueUpDao;

    @Override
    public boolean add(QueueUp queueUp) {
        return queueUpDao.add(queueUp) > 1 ? false : true;
    }

    @Override
    public List<QueueUp> searchQueueList() {
        return queueUpDao.searchQueueList();
    }

    @Override
    public QueueUp findById(Long id) {
        return queueUpDao.findById(id);
    }

    @Override
    public Integer update(QueueUp queueUp) {
        return queueUpDao.update(queueUp);
    }

    @Override
    public QueueUp findByPatientId(Long patientId) {
        return queueUpDao.findByPatientId(patientId);
    }

    @Override
    public List<QueueUp> findByNoResponse() {
        return queueUpDao.findByNoResponse();
    }
}
